<?php

use Illuminate\Routing\Router;

Admin::registerAuthRoutes();

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');
    //用户列表
    $router->resource('/users', UserController::class);
    //用户下级列表
    $router->resource('/usersDistribute',UserDistributeController::class);

    //用户等级列表
    $router->resource('/userTeam', UserTeamController::class);
    //商品列表
    $router->resource('/goods', GoodsController::class);
    //$router->get('/api/goods','GoodsController@good');
    //优惠券
    $router->resource('/coupons',CouponController::class);
    //优惠券设置
    $router->resource('/couponsSetting',CouponSettingController::class);
    //优惠券api
    $router->get('/api/coupon','CouponSettingController@coupon');
    $router->resource('/couponSend',CouponJobController::class);
    //订单
    $router->get('order/{order}', 'OrdersController@show')->name('order.show');
    //批量接单
    $router->post('order/orders/sureOrders','OrdersController@sureOrders');
    //打印快递模板
    $router->get('order/{order}/print','OrdersController@printExpress')->name('order.print');
    $router->post('order/{order}/sure','OrdersController@sure')->name('order.sure');
    $router->get('order/orders/sureList','OrdersController@sureList');
    $router->resource('/order',OrdersController::class);

    //物流
    $router->post('orders/{order}/ship', 'OrdersController@ship')->name('admin.orders.ship');
    //订单取消
    $router->post('order/{order}/cancel','OrdersController@cancel')->name('order.cancel');
    //首页页面设置
    $router->resource('/homePage',HomePageController::class);
    //自动打款
    $router->get('/withdraw/submit','WithdrawController@submit');
    //人工打款
    $router->get('/withdraw/people','WithdrawController@people')->name('withdrawPeople');
    //拒绝打款
    $router->get('/withdraw/refuse','WithdrawController@refuse')->name('withdrawRefuse');
    //提现查看处理
    $router->get('/withdraw/{withdraw}','WithdrawController@show')->name('withdraw.show');
    //提现处理
    $router->resource('/withdraw',WithdrawController::class);
    //订单销量统计
    $router->resource('/orderGoods',OrderGoodsController::class);
    //订单销售额统计
    $router->resource('/orderCount',OrderCountController::class);
    //财务管理 会员收益统计
    $router->get('/userMoney','UserMoneyController@index');
    //会员结算明细
    $router->resource('/userMoneyLog',UserMoneyLogController::class);
    //会员批量结算
    $router->post('/userMoneyLog/settlement','UserMoneyLogController@settlement');
    //发货人地址设置
    $router->get('/senderConfig/{senderConfig}/edit','SendConfigController@edit')->name('senderConfig.edit');
    $router->put('/senderConfig/{senderConfig}','SendConfigController@update')->name('senderConfig.update');
    //发货人地址设置
    //分销提成比例
    $router->get('/distributeConfig/{id}/edit','DistributeConfigController@edit')->name('distributeConfig.edit');
    $router->put('/distributeConfig/{id}','DistributeConfigController@update')->name('distributeConfig.update');
    //客服设置
    $router->get('/CustomerConfig/{id}/edit','CustomerConfigController@edit')->name('distributeConfig.edit');
    $router->put('/CustomerConfig/{id}','CustomerConfigController@update')->name('CustomerConfig.update');
    //推广数量统计
    $router->resource('/userCount',UserCountController::class);
});
